<div class="comments form">
<table class="blog">
	<tr>
		<td>
		<table width="100%" cellpadding="10" cellspacing="0" class="post">
			<tr>
				<td><?php echo $this->Html->link('<h2>'.$post['Post']['name'].'</h2>', array('action' => 'view', $post['Post']['id']),array('escape'=>false)); ?>
					&nbsp;
				</td>
			</tr>
			<tr>
				<td class="content">
				<?php echo $post['Post']['content'];?>&nbsp;
				</td>
			</tr>
			<tr>
				<td>
					<table class="corners" bgcolor="#bbbbbb" cellpadding="4" width="100%" cellspacing="4">
						<tr>
							<td valign="middle" width="12%">
								<?php echo __('Comments:',true)?>
							</td>
							<td valign="middle" align="center" width="3%">
								<?php echo count($post['Comment'])?>
								
							</td>
							<td valign="middle" width="45%" align="right"><?php echo __('Added:',true)?>&nbsp;</td>
							<td align="right" valign="middle" width="40%">
								<?php echo $post['Post']['modified']; ?>&nbsp;
							</td>								
						</tr>
					</table>
				</td>
			</tr>
		</table>
		</td>
	</tr>
</table>
<?php echo $this->Form->create('Comment');?>
	<fieldset>
 		<legend><?php __('Add Comment'); ?></legend>
	<?php
		echo $this->Form->input('name');
		echo (isset($post['Post']['id']) && is_numeric($post['Post']['id'])) ? $this->Form->hidden('post_id',array('value'=>$post['Post']['id'])) : $this->Form->input('post_id') ;
		echo $this->Form->input('content');
		if($session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'admin' || $session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'manag')
		echo $this->Form->input('status');
	?>
	</fieldset>
<?php echo $this->Form->end(__('Submit', true));?>
</div>
<div class="comments form">
	<table class="blog">
		<?php foreach ($post['Comment'] as $coment): ?>
		<?php if($coment['status']){?>
		<tr>
			<td>
			<table width="100%" cellpadding="10" cellspacing="0" class="post">
				<tr>
					<td class="content">
					<?php echo $coment['content']?>&nbsp;</td>
				</tr>
				<tr>
					<td>
						<table class="corners" bgcolor="#bbbbbb" cellpadding="4" width="100%" cellspacing="4">
							<tr>
								<td valign="middle" width="15%">
									<?php echo __('First Name:',true)?>
								</td>
								<td valign="middle" align="left" width="30%">
									<?php echo $coment['name']?>									
								</td>
								<td valign="middle" width="15%" align="right">
									<?php echo __('Added:',true)?>
								</td>
								<td valign="middle" width="40%" align="left"><?php echo $coment['added']?>&nbsp;</td>
			
							</tr>
						</table>
					</td>
				</tr>
			</table>
			</td>
		</tr>
		<?php }?>
		<?php endforeach; ?>
	</table>
</div>
